Hybrid sorting